ln
Type
function
Summary
Returns the natural logarithm of a number.
Syntax
the ln of <number>
ln(<number>)
Description
Use the ln function to obtain a base e logarithm.
The natural logarithm of a number is the power to which e must be raised to obtain the number.
The transcendental number e appears in many mathematical formulas.
To find the logarithm of a number in any base, use the following function:
function logarithm theBase,theNumber
return ln(theNumber)/ln(theBase)
end logarithm
If a math operation on finite inputs produces a non-finite output, an execution error is thrown. See math operations for more information.
Parameters
Name | Type | Description |
---|---|---|
number | A positive number, or an expression that evaluates to a positive number. |
Examples
ln(1) -- returns zero
ln(0.15) -- returns -1.89712
ln(10) -- returns 2.302585
Related
control structure: function
glossary: return, math operation
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile